Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make fit for xr=0.15.1 #348

Merged
merged 6 commits into from
Apr 15, 2020
Merged

make fit for xr=0.15.1 #348

merged 6 commits into from
Apr 15, 2020

Conversation

aaronspring
Copy link
Collaborator

@aaronspring aaronspring commented Apr 3, 2020

Description

Closes #316

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Pre-Merge Checklist (final steps)

  • I have rebased onto master or develop (wherever I am merging) and dealt with any conflicts.
  • I have squashed commits to a reasonable amount, and force-pushed the squashed commits.

@coveralls
Copy link

coveralls commented Apr 3, 2020

Coverage Status

Coverage decreased (-0.1%) to 90.602% when pulling bb5310a on AS_adapt_xr0151 into 8be0a89 on master.

@aaronspring aaronspring self-assigned this Apr 3, 2020
@aaronspring aaronspring requested a review from bradyrx April 3, 2020 19:43
@@ -89,7 +89,8 @@ def compute_persistence(
# at lead 0 is == 1.
if [0] in hind.lead.values:
hind = hind.copy()
hind['lead'] += 1
with xr.set_options(keep_attrs=True):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First time I use this :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never get it to work consistently, but I'm glad it does here!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a small comment as to what this fixes? What attributes were being dropped?

@aaronspring aaronspring mentioned this pull request Apr 6, 2020
@aaronspring aaronspring requested a review from ahuang11 April 8, 2020 13:18
Comment on lines 33 to 34
da['lead'] = da['lead'] + 1
da['init'] = da['init'] - 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the plus and minus are backwards here and should be fixed. Lead goes back 1 to start at zero; init goes forward one since lead was modified to start at zero.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for finding this. however the tests didnt find this!

Copy link
Collaborator

@bradyrx bradyrx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two very small changes. A comment before the with xr.options() line and a potential typo for conftest.

@bradyrx
Copy link
Collaborator

bradyrx commented Apr 14, 2020

@aaronspring , also make sure to require xr>=0.15.1 in requirements.txt, ci/environment and docs/requirements.

@aaronspring
Copy link
Collaborator Author

@aaronspring , also make sure to require xr>=0.15.1 in requirements.txt, ci/environment and docs/requirements.

We don’t require 0.15.1 with these changes. Do we?

@bradyrx
Copy link
Collaborator

bradyrx commented Apr 15, 2020

@aaronspring , also make sure to require xr>=0.15.1 in requirements.txt, ci/environment and docs/requirements.

We don’t require 0.15.1 with these changes. Do we?

We do so that the skipna feature in xr.quantile works right? If they have an older version of xarray installed in an environment and then install climpred, it currently doesn't force the upgrade. So it would cause an error if they ran that code.

@aaronspring
Copy link
Collaborator Author

forgot about skipna in quantile. True your right

@bradyrx
Copy link
Collaborator

bradyrx commented Apr 15, 2020

forgot about skipna in quantile. True your right

Make sure to add to requirements.txt too. That's what drives the package version. The environment.yml just drives us as developers.

@bradyrx
Copy link
Collaborator

bradyrx commented Apr 15, 2020

Looks good, thanks @aaronspring !

@bradyrx bradyrx merged commit 583fba7 into master Apr 15, 2020
@aaronspring aaronspring deleted the AS_adapt_xr0151 branch July 6, 2020 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reimplement xr.quantile once xarray v0.15.1 is released and equally fast
3 participants